package com.mashibing.jvm;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Hello {
    private static final int MAX_UPDATE_COUNT = 2;

    public static void main(String[] args) {
        Arrays.asList(null);
        List<String> skus = new ArrayList<>();
        skus.add("1");
        skus.add("2");
        skus.add("3");
        skus.add("4");
        skus.add("5");

        if (skus == null || skus.size() <= 0) {
            return;
        }
        long updateResult = 0;
        int multiple = skus.size() / MAX_UPDATE_COUNT;
        int multipleSize = multiple * MAX_UPDATE_COUNT;
        int remainder = skus.size() - multipleSize;

        for (int i = 0; i < multiple; i++) {
            int start = i * MAX_UPDATE_COUNT;
            int end = i * MAX_UPDATE_COUNT + MAX_UPDATE_COUNT;
            List<String> strings = skus.subList(start, end);
        }

        if(remainder > 0) {
            List<String> strings = skus.subList(multipleSize, skus.size());
        }

        return;

    }

    public void m() {
        System.out.println("Hello JVM!");
    }
}
